﻿using System;

namespace Annotations
{
    /// <summary>
    /// Completes the association by providing the information about the inverse role when the inverse association role is navigable (it is declared in the class).
    /// Otherwise use the AssociationAttribute
    /// </summary>
    [AttributeUsage(AttributeTargets.Property , AllowMultiple = false)]
    public class InversePropertyAttribute : Attribute
    {
        /// <summary>
        /// The type that declares the inverse role. If not provided it will be the property type of the association role this attribute is applied to
        /// </summary>
        public Type Declaring { get; set; }

        /// <summary>
        /// The name of the property that creates the inverse association role in the declaring type
        /// </summary>
        public string PropertyName { get; set; }

        /// <summary>
        /// The entity that is used to associate the roles
        /// </summary>
        public Type Associative { get; set; }
    }
}
